import * as Vuex from 'vuex'
import login from './login.js'
import currentUserCategory from './currentUserCategory.js'
import createPersistedState from "vuex-persistedstate"

const {
	createStore
} = Vuex
// console.log(Vuex)

const store = createStore({
	getters: {
		treeData(state) {
			return state.currentUserCategory.list
		},
		token(state) {
			return state.login.userInfo.token
		}
	},
	modules: {
		login,
		currentUserCategory
	},
	plugins: [createPersistedState()]
})


export default store
